package com.vallis.asfc.controller;


import com.vallis.asfc.entity.Role;
import com.vallis.asfc.service.RoleService;
import com.vallis.asfc.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author vallis
 * @since 2020-06-14
 */
@RestController
@CrossOrigin
@RequestMapping("/role")
public class RoleController {
@Autowired
    private RoleService roleService;
    @GetMapping("getAllRoles")
    public Result getAllRoles(){
        System.out.println("获取角色");

        return new Result("获取角色成功",roleService.list());
    }
    @PostMapping("addRole")
    public Result addRole(String roleName,String roleDesc,int parentid){

        Role r=new Role();

return null;

    }

}
